from SmartHouseServer_new.Database.Sql_Func import add_sql, insert_light, insert_garage_door, insert_gate, insert_window

mydb, mycursor = add_sql()


def light(device, work_mode, on_off):
    result = f"{device} is {on_off}"
    result_2 = insert_light(mydb, mycursor, work_mode, on_off)

    return result, result_2


def catDoor(device, on_off):
    result = f"{device} is {on_off}"
    result_2 = insert_garage_door(mydb, mycursor, device, on_off)

    return result, result_2


def door(device, work_mode, on_off):
    result = f"{device} is {on_off}"
    result_2 = insert_gate(mydb, mycursor, work_mode, on_off)

    return result, result_2


def window(device, work_mode, on_off):
    result = f"{device} is {on_off}"
    result_2 = insert_window(mydb, mycursor, work_mode, on_off)

    return result, result_2
